Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixed "The CJS build of Vite's Node API is deprecated" reported by vite #1002

Merged
merged 1 commit into from
May 1, 2024

Conversation

ericleponner
Copy link
Collaborator

Description:

Since a while, vite reports the following deprecation warning:

/usr/local/bin/npm run test:unit

> [email protected] test:unit
> vitest run

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

 RUN  v1.5.3 /Users/eric/Documents/Hedera/WS/hedera-mirror-node-explorer
...

Changes below applies recommended fix (type="module" in package.json).

However this change alone breaks cypress execution ;(

Your configFile is invalid: /Users/eric/Documents/Hedera/WS/hedera-mirror-node-explorer/cypress.config.ts

It threw an error when required, check the stack trace below:

ReferenceError: exports is not defined in ES module scope
    at file:///Users/eric/Documents/Hedera/WS/hedera-mirror-node-explorer/cypress.config.ts:2:23
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
...

So changes also rename cypress.config.ts as cypress.config.js as recommended here.

@ericleponner ericleponner requested a review from svienot May 1, 2024 11:11
Copy link

github-actions bot commented May 1, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 83.05% 38970 / 46923
🔵 Statements 83.05% 38970 / 46923
🔵 Functions 62.87% 884 / 1406
🔵 Branches 84.24% 4059 / 4818
File CoverageNo changed files found.
Generated in workflow #817

Copy link

sonarqubecloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@svienot svienot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@svienot svienot merged commit 6163d82 into main May 1, 2024
7 checks passed
@svienot svienot deleted the vite_warning branch May 1, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants